<?php include $this->admin_tpl('meta');?>
<title>岗位管理</title>
<link href="<?php echo STATIC_URL;?>plugin/editable/css/jquery-editable.css" rel="stylesheet"/>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 人事管理 <span class="c-gray en">&gt;</span> 岗位列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
  <div> 
    <form action="<?php echo U('init');?>" method="get" id="search">
	 <input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
	 <input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
	 <input type="hidden" value="search" name="a">
     <span class="select-box inline">
		<select name="department_id" class="select">
			<option value="">请选择部门</option>
			<?php echo $select_menus;?>
		</select>
	</span>
     <span class="select-box inline">
		<select name="status" class="select">
        <option value="">是否启用</option>
		<option <?php if(isset($_GET["status"]) && $_GET["status"]=='0'){echo 'selected';} ?> value="0">关闭</option>
		<option <?php if(isset($_GET["status"]) && $_GET["status"]=='1'){echo 'selected';} ?> value="1">开启</option>
		</select>
	</span>
     <input type="text" name="name" style="width:150px;" placeholder="请输入岗位名称" class="input-text search" value="<?php if(isset($_GET['name'])) echo $_GET['name'];?>">
	 <button name="dosubmit" class="btn btn-success radius" type="submit" value="1"><i class="yzm-iconfont yzm-iconsousuo"></i> 搜索</button>
	 <a class="btn btn-primary radius" href="<?php echo U('init');?>"><i class="yzm-iconfont yzm-iconshuaxin"></i> 清空</a>
	 </form>	
  </div>
  <div class="cl mt-15 tb-top"> 
  <span class="l">
  <a href="javascript:;" onclick="yzm_open('添加岗位','<?php echo U('add');?>',800,700)" class="btn btn-primary radius"><i class="yzm-iconfont yzm-icontianjia"> 添加岗位</i></a>
  <a href="javascript:;" onclick="yzm_dels('ids', 1)" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"> 批量删除</i></a> 
  </span> <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> </div>
  <form method="post" action="<?php echo U('del');?>" id="myform">
  <table class="table table-border table-bg table-hover yzm-table-sort">
    <thead>
      <tr class="text-c">
        <th width="25"><input type="checkbox"></th>
		<th width="50">ID<?php echo field_order('id');?></th>
		<th class="text-l">岗位名称</th>
		<th width="350" class="text-l">部门<?php echo field_order('department_id');?></th>
		<th width="100">年假天数</th>
		<th width="200">招聘要求</th>
		<th width="100">部门在职人数</th>
		<th width="50">状态<?php echo field_order('status');?></th>
		<th width="135">更新时间<?php echo field_order('add_time');?></th>
		<th width="150">管理操作</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><input type="checkbox" value="<?php echo $val['id']?>" name="ids[]"></td>
			<td><?php echo $val['id']?></td>
			<td class="text-l"><?php echo $val['name'];?></td>
			<td class="text-l"><?php echo $val['department_name'];?></td>
			<td><?php echo $val['leave_days'];?></td>
			<td class="text-c">
			<span class="text-c" onclick="open_text('<?php echo $val['text']?>')"><?php echo $val['text'] != '' ? '<span class="c-primary">点击查看</span>' : '-';?></span>
			</td>
			<td><?php echo $val['total'];?></td>
			<td>
				<?php if($val['status']){ ?>
				<span class="yzm-status-enable" data-field="status" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe81f;</i>是</span>
				<?php }else{ ?>
				<span class="yzm-status-disable" data-field="status" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe601;</i>否</span>
				<?php } ?>
			</td>
			<td><?php echo date('Y-m-d H:i:s', $val['add_time'])?></td>
			<td>
				<a title="编辑部门" href="javascript:;" onclick="yzm_open('编辑岗位','<?php echo U('edit',array('id'=>$val['id']));?>',800,700)" style="text-decoration:none" class="btn-mini btn-primary ml-5">编辑</a>
				<a title="删除" href="javascript:;" onclick="yzm_del('<?php echo U('delete',array('id'=>$val['id']));?>')" style="text-decoration:none" class="btn-mini btn-danger ml-5">删除</a>
			</td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></i> 暂无数据</div><?php } ?>
  </form>
  <div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/editable/js/jquery.poshytip.js"></script>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/editable/js/jquery-editable-poshytip.min.js"></script>
<script type="text/javascript">
function open_text(text){
	layer.open({
	  title: '查看招聘要求',
	  content: text,
	  area: ['600px', '500px'], 
	  success: function(layero, index){
		//open_tag('.btn_tag2');
	  }
	})
}
</script>

</body>
</html>